import 'package:baselib/utils/image_util.dart';
import 'package:baselib/utils/navigator_util.dart';
import 'package:baselib/widgets/gradient_card_view.dart';
import 'package:baselib/widgets/gradient_text_widget.dart';
import 'package:baselib/widgets/inkwell_button.dart';
import 'package:flutter/material.dart';
import 'package:framelib/utils/color_util.dart';
import 'package:framelib/utils/drawable_util.dart';
import 'package:framelib/utils/px_util.dart';
import 'package:framelib/utils/string_util.dart';

class ChatRoomOperWidget extends StatelessWidget {
  bool  isShowReportOper;
  bool  isShowBlackOper;
  bool  isInBlackList;
  Function cancelSelectedFunc;
  Function reportSelectedFunc;
  Function blackSelectedFunc;
  ChatRoomOperWidget({Key key,
    this.isShowReportOper,this.isShowBlackOper,this.isInBlackList,
    this.cancelSelectedFunc,this.reportSelectedFunc,this.blackSelectedFunc,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return AnimatedPadding(
      padding: MediaQuery.of(context).viewInsets,
      duration: Duration(milliseconds: 100),
      child: Container(
        width: PxUtil.instance.screenWidth,
        padding: EdgeInsets.only(
          bottom: PxUtil.instance.px_10,
          top: PxUtil.instance.px_10,
        ),
        color: ColorUtil.instance.color_transparent,
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            (isShowReportOper??true)?
            InkWellButton(
              onPressed: (){
                NavigatorUtil.goBack();
                if(reportSelectedFunc!=null)reportSelectedFunc();
              },
              child: GradientCardView(
                elevation: PxUtil.instance.px_0,
                width: PxUtil.instance.screenWidth-PxUtil.instance.px_30,
                height: PxUtil.instance.px_44,
                alignment: Alignment.center,
                gradient: LinearGradient(
                    begin: Alignment.topCenter,
                    end: Alignment.bottomCenter,
                    colors: [
                      ColorUtil.instance.color_7776FF,
                      ColorUtil.instance.color_AD2CF1,
                    ]
                ),
                borderRadius: BorderRadius.circular(
                    PxUtil.instance.px_8),
                child: Container(
                  alignment: Alignment.center,
                  decoration: BoxDecoration(
                    color: ColorUtil.instance.color_white,
                    borderRadius: BorderRadius.circular(
                        PxUtil.instance.px_8),
                  ),
                  padding: EdgeInsets.only(
                    left: PxUtil.instance.px_12,
                    right: PxUtil.instance.px_12,
                    top: PxUtil.instance.px_5,
                    bottom: PxUtil.instance.px_5,
                  ),
                  child: GradientTextWidget(
                    txt: StringUtil.instance.Report,
                    txtStyle: TextStyle(
                      fontSize: PxUtil.instance.px_18,
                      fontWeight: FontWeight.bold,
                    ),
                  )
                  // ImagesUtil.loadAssetImage(
                  //     DrawableUtil.instance.icon_button_report,
                  //     height: PxUtil.instance.px_14,
                  //     fit: BoxFit.fitHeight
                  // ),
                ),
              ),
            ):SizedBox(width: PxUtil.instance.px_0,),
            (isShowBlackOper??true)?
            InkWellButton(
              onPressed: (){
                NavigatorUtil.goBack();
                if(blackSelectedFunc!=null)blackSelectedFunc();
              },
              child: GradientCardView(
                elevation: PxUtil.instance.px_0,
                width: PxUtil.instance.screenWidth-PxUtil.instance.px_30,
                height: PxUtil.instance.px_44,
                alignment: Alignment.center,
                gradient: LinearGradient(
                    begin: Alignment.topCenter,
                    end: Alignment.bottomCenter,
                    colors: [
                      ColorUtil.instance.color_7776FF,
                      ColorUtil.instance.color_AD2CF1,
                    ]
                ),
                borderRadius: BorderRadius.circular(
                    PxUtil.instance.px_8),
                child: Container(
                  alignment: Alignment.center,
                  decoration: BoxDecoration(
                    color: ColorUtil.instance.color_white,
                    borderRadius: BorderRadius.circular(
                        PxUtil.instance.px_8),
                  ),
                  padding: EdgeInsets.only(
                    left: PxUtil.instance.px_12,
                    right: PxUtil.instance.px_12,
                    top: PxUtil.instance.px_5,
                    bottom: PxUtil.instance.px_5,
                  ),
                  child: GradientTextWidget(
                    txt: (isInBlackList??false)?StringUtil.instance.Unblack:StringUtil.instance.Black,
                    txtStyle: TextStyle(
                      fontSize: PxUtil.instance.px_18,
                      fontWeight: FontWeight.bold,
                    ),
                  )
                  // ImagesUtil.loadAssetImage(
                  //     DrawableUtil.instance.icon_button_black,
                  //     height: PxUtil.instance.px_14,
                  //     fit: BoxFit.fitHeight
                  // ),
                ),
              ),
            ):SizedBox(width: PxUtil.instance.px_0,),
            SizedBox(height: PxUtil.instance.px_18,),
            InkWellButton(
              onPressed: (){
                NavigatorUtil.goBack();
                if(cancelSelectedFunc!=null)cancelSelectedFunc();
              },
              child: GradientCardView(
                elevation: PxUtil.instance.px_0,
                width: PxUtil.instance.screenWidth-PxUtil.instance.px_30,
                height: PxUtil.instance.px_44,
                alignment: Alignment.center,
                gradient: LinearGradient(
                    begin: Alignment.topCenter,
                    end: Alignment.bottomCenter,
                    colors: [
                      ColorUtil.instance.color_7776FF,
                      ColorUtil.instance.color_AD2CF1,
                    ]
                ),
                padding: EdgeInsets.only(
                  left: PxUtil.instance.px_12,
                  right: PxUtil.instance.px_12,
                  top: PxUtil.instance.px_5,
                  bottom: PxUtil.instance.px_5,
                ),
                borderRadius: BorderRadius.circular(
                    PxUtil.instance.px_8),
                child: ImagesUtil.loadAssetImage(
                    DrawableUtil.instance.icon_button_cancel,
                    height: PxUtil.instance.px_14,
                    fit: BoxFit.fitHeight
                ),
              ),
            )
          ],
        ),
      ),
    );
  }
}
